import static org.junit.Assert.*;

import org.junit.Before;
import org.junit.Test;

import com.pavlinic.mylisp.Expression;
import com.pavlinic.mylisp.LispTestCase;
import com.pavlinic.mylisp.repl.Bootstrapper;


public class ArithmeticFunctionsTest extends LispTestCase {
	@Before public void bootstrap() {
		Bootstrapper.getInstance().bootstrap();
	}
	
	@Test public void plus() {
		final Expression expected = parse("10");
		final Expression got = eval("(+ 1 2 3 4)");
		assertEquals(expected, got);
	}
	
	@Test public void times() {
		final Expression expected = parse("24");
		final Expression got = eval("(* 1 2 3 4)");
		assertEquals(expected, got);
	}
	
	@Test public void moreComplexExpression() {
		final Expression expected = parse("47");
		final Expression got = eval("(+ 2 3 (* 7 6))");
		assertEquals(expected, got);
	}
}
